import fetch from '../util/fetch2';

export function login(params: any) {
  return fetch({
    url: '/login',
    body: params,
    method: 'POST',
  });
}
export function register(params: any) {
  return fetch({
    url: '/register',
    body: params,
    method: 'POST',
  });
}

export function getResumeDetail(params: any) {
  return fetch({
    url: '/getResumeDetail',
    params,
    method: 'GET',
  });
}
export function addResumeDetail(params: any) {
  return fetch({
    url: '/addResumeDetail',
    body: params,
    method: 'POST',
  });
}

export function addContent(params: any) {
  return fetch({
    url: '/addContent',
    body: params,
    method: 'POST',
  });
}

export function editContent(params: any) {
  return fetch({
    url: '/editContent',
    body: params,
    method: 'POST',
  });
}

export function editSectionName(params: any) {
  return fetch({
    url: '/editSectionName',
    body: params,
    method: 'POST',
  });
}

export function delContent(params: any) {
  return fetch({
    url: '/delContent',
    body: params,
    method: 'POST',
  });
}

export function addEntry(params: any) {
  return fetch({
    url: '/addEntry',
    body: params,
    method: 'POST',
  });
}
export function delEntry(params: any) {
  return fetch({
    url: '/delEntry',
    body: params,
    method: 'POST',
  });
}

export function editEntry(params: any) {
  return fetch({
    url: '/editEntry',
    body: params,
    method: 'POST',
  });
}

export function toggleHideEntry(params: any) {
  return fetch({
    url: '/toggleHideEntry',
    params,
    method: 'GET',
  });
}
export function sortEntry(params: any) {
  return fetch({
    url: '/sortEntry',
    body: params,
    method: 'POST',
  });
}

export function updatePersonalDetail(params: any) {
  return fetch({
    url: '/updatePersonalDetail',
    body: params,
    method: 'POST',
  });
}

export function getTemplates(params?: any) {
  return fetch({
    url: '/getTemplates',
    params,
    method: 'GET',
  });
}
export function getTemplatesByClassify(params?: any) {
  return fetch({
    url: '/getTemplatesByClassify',
    params,
    method: 'GET',
  });
}

export function applyTemplate(params?: any) {
  return fetch({
    url: '/applyTemplate',
    body: params,
    method: 'POST',
  });
}
export function updateCustomization(params?: any) {
  return fetch({
    url: '/updateCustomization',
    body: params,
    method: 'POST',
  });
}

export function addCustomization(params?: any) {
  return fetch({
    url: '/addCustomization',
    body: params,
    method: 'POST',
  });
}

export function downloadFile(params?: any) {
  return fetch({
    url: '/downloadFile',
    body: params,
    method: 'POST',
    responseType: 'arraybuffer',
    getResponse: true,
  });
}
export function downloadFileById(params?: any) {
  return fetch({
    url: '/downloadFileById',
    body: params,
    method: 'POST',
    responseType: 'arraybuffer',
    getResponse: true,
  });
}

export function upload(params?: any) {
  return fetch({
    url: '/upload',
    body: params,
    method: 'POST',
  });
}

export function uploadFile(params?: any) {
  return fetch({
    url: '/uploadFile',
    body: params,
    method: 'POST',
  });
}
export function uploadTemp(params?: any) {
  return fetch({
    url: '/uploadTemp',
    body: params,
    method: 'POST',
  });
}

export function getTemplateById(params?: any) {
  return fetch({
    url: '/getTemplateById',
    body: params,
    method: 'POST',
  });
}

export function addTemplate(params?: any) {
  return fetch({
    url: '/addTemplate',
    body: params,
    method: 'POST',
  });
}
export function updateTemplates(params?: any) {
  return fetch({
    url: '/updateTemplates',
    body: params,
    method: 'POST',
  });
}

export function getResumes(params?: any) {
  return fetch({
    url: '/getResumes',
    params,
    method: 'GET',
  });
}

export function alipayPay(params?: any) {
  return fetch({
    url: '/alipay/pay',
    body: params,
    method: 'POST',
  });
}

export function getTemplateByMid(params?: any) {
  return fetch({
    url: '/getTemplateByMid',
    body: params,
    method: 'POST',
  });
}

export function updateStatus(params?: any) {
  return fetch({
    url: '/updateStatus',
    body: params,
    method: 'POST',
  });
}
export function tempDel(params?: any) {
  return fetch({
    url: '/tempDel',
    body: params,
    method: 'POST',
  });
}

export function getStations(params?: any) {
  return fetch({
    url: '/getStations',
    params,
    method: 'get',
  });
}

export function getCvTemp(params?: any) {
  return fetch({
    url: '/getCvTemp',
    params,
    method: 'get',
  });
}
export function getCvTempList(params?: any) {
  return fetch({
    url: '/getCvTempList',
    params,
    method: 'get',
  });
}

export function getResumeDetailWithoutGuards(params?: any) {
  return fetch({
    url: '/getResumeDetailWithoutGuards',
    params,
    method: 'get',
  });
}

export function deleteResume(params?: any) {
  return fetch({
    url: '/deleteResume',
    params,
    method: 'GET',
  });
}

export function validResume(params?: any) {
  return fetch({
    url: '/validResume',
    params,
    method: 'GET',
  });
}

export function checkVipInfo(params?: any) {
  return fetch({
    url: '/checkVipInfo',
    method: 'POST',
  });
}

export function downloadWord(params?: any) {
  return fetch({
    url: '/downloadWord',
    body: params,
    method: 'POST',
    responseType: 'arraybuffer',
    getResponse: true,
  });
}
export function getVipTypes(params?: any) {
  return fetch({
    url: '/getVipTypes',
    params: params,
    method: 'get',
  });
}
